<template>
    <div class="MedicalRecord">
        <div class="myMedical nBox">
            <div class="h0">
                <p class="lt">病历资料</p>
            </div>
            <div class="listArea">
                <h6>病历列表<i class="fa fa-chevron-circle-right"></i></h6>
                <div class="content">
                    <dl>
                        <dt><b class="fa-caret-down fa"></b><i class="fa fa-folder"></i>2019-07-15 住院 干部保健科</dt>
                        <dd><i class="fa fa-file-text-o"></i>14.07.15 15:19 首次病程记录</dd>
                        <dd><i class="fa fa-file-text-o"></i>14.07.15 15:20 再次或多次入院</dd>
                    </dl>
                    <dl>
                        <dt><b class="fa-caret-right fa"></b><i class="fa fa-folder"></i>2019-07-15 住院 便民门诊</dt>
                        <dd><i class="fa fa-file-text-o"></i>门诊病历</dd>
                    </dl>
                    <dl>
                        <dt><b class="fa-caret-right fa"></b><i class="fa fa-folder"></i>2019-06-15 住院 便民门诊</dt>
                        <dd><i class="fa fa-file-text-o"></i>门诊病历</dd>
                    </dl>
                </div>
            </div>
            <div class="printArea">
                <div>
                    <h4>医院名称</h4>
                    <h5>住院病历</h5>
                    <div class="line1">
                        <p>患者：<b>测试</b></p>
                        <p>病区：<b>综合病区</b></p>
                        <p>床号：<b>8</b></p>
                        <p>住院号：<b>206000009</b></p>
                    </div>
                    <div class="line2 clearfix">
                        <p><span>姓 名：</span><b>测试</b></p>
                        <p><span>性 别：</span><b>男</b></p>
                        <p><span>年 龄：</span><b>10岁</b></p>
                        <p><span>婚 否：</span>未婚</p>
                        <p><span>民 族：</span><b>汉族</b></p>
                        <p><span>职 业：</span>儿童</p>
                        <p><span>出 生 地：</span>新疆</p>
                        <p><span>现 住 址：</span></p>
                        <p><span>入院日期：</span><b>2015-03-11 17:00</b></p>
                        <p><span>记录日期：</span><b>2015-03-11 17:00</b></p>
                        <p><span>供 史 者：</span></p>
                        <p><span>可靠程度：</span>可靠</p>
                    </div>
                    <div class="line3">
                        <p><b>主诉：</b>咳嗽、咳痰5日，加重1日</p>
                        <p>
                            <b>现病史：</b>
                            <span>患儿母亲代述：患儿因受凉于2015-03-10出现清流鼻涕，阵发性咳嗽</span>
                        </p>
                    </div>
                </div>
            </div>
        </div>


    </div>
</template>
<script>
    export default {
        name: "Modularinformation",
        data() {
            return {
                msg: "SystemManagement 下的 Modularinformation",

            };
        },
        methods: {
            openDetails(row, index) {
                this.model_id = row.id;
                this.model_name = row.name;
                this.changeSelectStyle = index;
                if (this.model_XZBJ == "1") {
                    this.model_jm = row.id;
                    this.queryz();
                    this.changeSelectStyle = "0";
                    this.model_jm = "";
                }

                console.log(row);
            },
            handleChange(val) {
                console.log(val);
            },
            //主表保存
            savez() {
                if (this.model_name == "") {
                    this.$message({showClose: true, message: "模块名称不能为空！", type: "error"});
                    return;
                }
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11041",
                    input: {
                        "id": this.model_id == "" ? "1" : this.model_id,
                        "name": this.model_name
                    }
                };
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (res.code == 0) {
                            this.model_XZBJ = "1"
                            this.$message({message: res.msg, type: "success"});
                            this.queryz();
                            this.addMasterUser();
                            document.getElementById("2").focus();
                        } else {
                            this.$message({showClose: true, message: res.msg, type: "error"});
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //删除主表信息
            deletez() {
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11043",
                    input: {
                        "id": this.model_id
                    }
                };
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (res.code == 0) {
                            this.$message({message: res.msg, type: "success"});
                            this.queryz();
                            this.addMasterUser();
                        } else {
                            this.$message({showClose: true, message: res.msg, type: "error"});
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //主表查询

            queryz() {
                this.model_query = [];
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11042",
                    input: {
                        jm: this.model_jm ? this.model_jm : ""
                    }
                };
                console.log(data)
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (this.model_XZBJ == "1") {
                            this.model_query.push( res.data[res.data.length - 1]);this.model_XZBJ = "";
                            this.changeSelectStyle = "0";
                        } else {
                            this.model_query = res.data;
                            this.addMasterUser();
                        }
                        console.log("查询结果");
                        console.log(res);
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            submit1() {
                var ele = window.event.srcElement;
                var idcount = parseInt(ele.id) + 1;

                document.getElementById(idcount + "").focus();
            },

        },
        mounted(){

        },
        created() {
            this.msg = this.$route.query;
            console.log("接收过来的传参#############################################################################")
            console.log(this.msg)
            if (this.msg.Token != null && this.msg.Token != "") {
                console.log("设置Token")
                this.$setToken(this.msg.Token)
                this.$setItemUrl(this.msg.ItemIP)
                var loginInfor = this.msg.loginInfor;
                this.LoginInfor = JSON.parse(loginInfor);
                console.log("个人登录信息");
                console.log(this.LoginInfor);
                if (this.LoginInfor != null) {
                    this.huizhenObj.Consult.HospitalId = this.LoginInfor.HospitalId
                    this.huizhenObj.Consult.DeptId = this.LoginInfor.UserId
                    this.huizhenObj.Consult.DoctorId = this.LoginInfor.UserId
                }
            } else {
                console.log("Token为空")
                var loginInfor = localStorage.getItem('LoginInfor');
                this.LoginInfor = JSON.parse(loginInfor);
                console.log("个人登录信息");
                console.log(this.LoginInfor);
                if (this.LoginInfor == null) {
                    this.LoginInfor = {
                        SectionName: "",
                        UserName: ""
                    }
                }
            }

        }
    };
</script>

<style lang="scss">
    .MedicalRecord{
        .myMedical h6{ background: #e8f2ff; font-size: 14px; color: #0089ef; height: 30px;
            line-height: 30px; padding: 0 0 0 10px;margin:0;border: 1px solid #c7dfff; border-radius: 2px;
            border-top: none; border-right: none;}
        .myMedical h6 i{ float: right; font-size: 18px; line-height: 30px; padding: 0 10px;}
        .myMedical .listArea{ position: absolute; top: 45px; left: 0; width: 320px; bottom: 0;overflow-y: auto; }
        .myMedical .listArea .content{padding-top: 9px;}
        .myMedical .listArea dl{ padding: 0 10px 0 0;margin-bottom:3px;}
        .myMedical .listArea dt{ line-height: 26px;}
        .myMedical .listArea dt b{ display: inline-block; width: 33px; color: #0092ff; font-size: 16px;
            cursor: pointer;padding-left: 13px;}
        .myMedical .listArea dt i{ display: inline-block; width: 20px; color: #bbb}
        .myMedical .listArea dd{ padding-left:54px; line-height: 24px; display: none;}
        .myMedical .listArea dd i{ display: inline-block; width: 20px; color: #999}
        .myMedical .listArea dl:first-child dd{ display: block; }
        .myMedical .printArea{position: absolute; top: 45px; left: 320px; bottom: 0; right: 0;
            overflow-y: auto; background: #aaa;}
        .myMedical .printArea>div{background: #fff; margin: 20px auto;border-radius: 2px;min-height: 500px;
            padding-bottom: 50px;max-width: 800px;}
        .myMedical .printArea h4{ text-align: center; color: blue; font-size: 20px; letter-spacing: 15px;
            font-weight: bold;padding: 20px 0 0 0}
        .myMedical .printArea h5{ text-align: center; color: blue; font-size: 18px; letter-spacing: 8px;}
        .myMedical .printArea .line1{ border-bottom: 1px solid #ccc; height: 40px;margin: 0 20px;
            line-height: 45px; overflow: hidden;}
        .myMedical .printArea .line1 p{ float: left;margin-left: 20px;}
        .myMedical .printArea .line1 p b{ margin-right: 50px; color: #0404d6;}
        .myMedical .printArea .line2{padding: 10px 0;}
        .myMedical .printArea .line2 p{ float: left;padding-left: 42px;line-height: 24px;}
        .myMedical .printArea .line2 p:nth-child(2n-1){width: 40%;}
        .myMedical .printArea .line2 p:nth-child(2n){width: 60%;}
        .myMedical .printArea .line2 p span{ display: inline-block; width: 70px;}
        .myMedical .printArea .line2 p b{color: #0404d6;}
        .myMedical .printArea .line3{padding: 0 42px;}
        .myMedical .printArea .line3 p{ margin-bottom: 5px;}
        .myMedical .printArea .line3 b{color: #0404d6;}
        /*选择平台页*/
        .IfChange{
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            border: none;
            padding-left: 200px;
        }
        /*公共管理头部*/
        .nBox .h0{
            height: 45px;
            padding:6px 0 0 9px;
            border-bottom:1px solid #d2ecff;
        }
        .nBox .h0 .lt{
            font-size: 18px;
            line-height: 32px;
            padding-left: 5px;
            color: #6bb1ec;
            font-weight: bold;
        }
        .nBox .h0 .rt{margin-right: 12px;}
        .nBox .h0 .rt .btn{margin-left: 5px;}
        .nBox .Ahead{ height: 32px;line-height: 32px;padding: 0 15px;
            background:#ecf4ff;     color: #0092ff;}
        .nBox .Ahead .btn{ padding: 2px 12px; margin-top: -4px;}
        .nBox .Ahead i{ color: #0092ff;cursor: pointer}
        .nBox .Tb label{margin: 0;display: block; cursor: pointer}
        .nBox .Tb label b{ margin-right: 5px; float: left}

        .nBox .menu{ padding: 0 10px 0 15px;}
        .nBox .menu dl{ margin-bottom: 2px; position: relative;}
        .nBox .menu dl:before{ content: ''; border-left: 1px dashed #a4d5ff; height: calc(90%);
            position: absolute; left: 6px; top: 24px; }
        .nBox .menu dl:last-child:before{ display: none; }
        .nBox .menu dt{ line-height:30px; font-weight: normal; color: #177ad0; }
        .nBox .menu label{margin: 0;}
        .nBox .menu label input{position: relative; top: 1px;margin-right: 5px;}
        .nBox .menu dt label{position: relative;margin-left: 2px;}
        .nBox .menu dt label:before{content: ''; width: 7px; height: 0; border-bottom: 1px dashed #ddd;
            position: absolute; left:-8px; top: 14px; }
        .nBox .menu dd{ margin-left: 28px; line-height: 24px; position: relative; cursor: pointer;
            padding-left: 16px;}
        .nBox .menu dd dd:hover,
        .nBox .menu dd.high{background: #ecf4ff; }
        .nBox .menu dd:before{ content: ''; border-left: 1px dashed #ddd; height: calc(100%);
            position: absolute; left: 0; top: 0;  }
        .nBox .menu dd:after{ content: ''; width: 13px; height: 0; border-bottom: 1px dashed #ddd;
            position: absolute; right: calc(100% - 15px); top: 11px; }
        .nBox .menu dd:last-child:before{ height: 11px;}
        .nBox .menu dd i{ color: #999; margin-right:6px;display: inline-block; width: 11px;}
        .nBox .menu dd label{ display: block;cursor: pointer}
        .nBox .menu dd b{ margin-left: -22px; position: relative; z-index: 2; top: -4px;}
        .nBox .menu dd dd{margin-left: 6px;}
        .nBox .menu b{ width: 12px; display: inline-block; line-height: 12px; padding-top: 0;
            height: 13px; font-weight: normal; float: left; background-color: #73b1e7;
            margin-top: 8px; margin-right: 8px; font-size: 14px; border-radius: 2px;
            text-align: center; color: #ffffff; outline: none; border: 0; cursor: pointer; }
        /*背景弹框*/
        .blackBg{
            position: fixed;
            z-index: 999;
            background: rgba(0,0,0,0.5);
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        .blackBg .closes{
            color: #666;
            font-size: 30px;
            position: absolute;
            right: 5px;
            top: 0;
            padding: 0 5px;
            cursor: pointer;
        }
        .blackBg .p500{
            width: 550px;
        }
        .blackBg .p1000{
            width: 1000px;
        }
        .pucType2 p{
            float: left;
            margin-left: 15px;
            margin-top: 5px;
        }
        .pucType3 p{
            float: left;
            margin-left: 10px;
            margin-top: 5px;
        }
        .pucType2 p span{
            background: #f6f6f6;
            height: 32px;
            float: left;
            border: 1px solid #ccc;
            margin-right: -2px;
            position: relative;
            padding-left: 5px;
            line-height: 31px;
            z-index: 2;
            border-top-left-radius: 3px;
            border-bottom-left-radius: 3px;
        }
        .pucType3 p span{
            background: #f6f6f6;
            height: 28px;
            float: left;
            border: 1px solid #ccc;
            margin-right: -2px;
            position: relative;
            padding-left: 5px;
            line-height: 27px;
            z-index: 2;
            border-top-left-radius: 3px;
            border-bottom-left-radius: 3px;
        }
        .pucType2 .form-control{
            width: 150px;
            padding: 0 5px;
        }
        .pucType3 .form-control{
            height: 28px;padding: 0 5px;
        }
        .pucType5 p{ float: left; margin-left: 10px; margin-top: 5px;}
        .pucType5 p label{ background: #f6f6f6; height: 28px; float: left; border: 1px solid #ccc;
            margin:0 -2px 0 0; position: relative; padding-left: 5px; line-height: 27px;
            z-index: 2; border-top-left-radius: 3px; border-bottom-left-radius: 3px;}
        .pucType5 .form-control{
            height: 28px;padding: 0 5px;width: 132px;
        }
        .Tb{border: 1px solid #ccc;}
        .Tb table{border: none; margin: 0;}
        .Tb table th:first-child,.Tb table td:first-child{ border-left: none;}
        .Tb table th:last-child,.Tb table td:last-child{ border-right: none;}
    }

</style>
